package cn.com.surker.production.entity.vo;

import cn.com.surker.enums.ICodeDescEnum;
import cn.com.surker.enums.production.car.CarModelTypeEnum;
import cn.com.surker.enums.production.car.CarWorkStatusEnum;
import cn.com.surker.enums.system.CarFuelEnum;
import cn.com.surker.production.entity.TranCar;
import cn.com.surker.util.MathUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 运输车辆显示类
 *
 * @author luotao
 * @date 2024/10/17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class TranCarVo extends TranCar {

	/**
	 * 燃油类型
	 */
	private String carFuelTxt;

	/**
	 * 车辆状态
	 */
	private String carStatusTxt;

	public String getCarFuelTxt() {
		Integer carFuel = getCarFuel();
		CarFuelEnum anEnum = ICodeDescEnum.getEnum(CarFuelEnum.class, carFuel);
		if (anEnum != null) {
			return anEnum.getDescription();
		} else {
			return "";
		}
	}

	public String getCarStatusTxt() {
		Integer carStatus = getCarStatus();
		CarWorkStatusEnum anEnum = ICodeDescEnum.getEnum(CarWorkStatusEnum.class, carStatus);
		if (anEnum != null) {
			return anEnum.getDescription();
		} else {
			return "";
		}
	}

	//	转换为吨位后的载重数据
	private Double loadWeightT;

	private Double maxWeightT;

	private Double tareT;

	public Double getLoadWeightT() {
		loadWeightT = MathUtils.divide(getLoadWeight(), 1000d);
		return loadWeightT;
	}

	public Double getMaxWeightT() {
		maxWeightT = MathUtils.divide(getMaxWeight(), 1000d);
		return maxWeightT;
	}

	public Double getTareT() {
		tareT = MathUtils.divide(getTare(), 1000d);
		return tareT;
	}

	/**
	 * 车辆自编号
	 */
	private String code;
}
